<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	request.setCharacterEncoding("utf-8");
	String cp = request.getContextPath();
	int i=0;
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>게 시 판</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

<link rel="stylesheet" href="<%=cp%>/community/css/gallery.css" type="text/css"/>

<script type="text/javascript" src="<%=cp%>/board/js/util.js"></script>
<script type="text/javascript">
	function searchData(){
		
		var f = document.searchForm;
		f.action = "<%=cp%>/community/gallery2.action";
		f.submit();
		
	}
</script>
</head>

<body>

	<div id="container">
		<div id="subNavigation">
			<h2><img src="<%=cp%>/community/image/h2_community.gif" alt="커뮤니티" /></h2>
			<ul class="leftMenu">
                <li><a href='<%=cp%>/community/hugi.action'><img src='<%=cp%>/community/image/subnavi_community1_on.gif' class='imgover' alt='여행후기' /></a></li>
                <li><a href='<%=cp%>/community/gallary.action'><img src='<%=cp%>/community/image/photo.gif' class='imgover' alt='포토갤러리' /></a></li>
                <li><a href='<%=cp%>/community/event.action'><img src='<%=cp%>/community/image/subnavi_community2_on.gif' class='imgover' alt='진행중인 이벤트' /></a></li>
                <li><a href='<%=cp%>/community/e_list.action'><img src='<%=cp%>/community/image/subnavi_community3_on.gif' alt='당첨자발표' /></a></li>
			</ul>
			<ul class="boardLink">
				<li><a href="<%=cp%>/info/s_created.action"><img src="<%=cp%>/community/image/main_qna.gif" alt="질문과 답변" /></a></li>
				<li><a href="<%=cp%>/info/qna.action"><img src="<%=cp%>/community/image/main_faq.gif" alt="자주하는 질문" /></a></li>
			</ul>
		</div>


		<div id="contents">
			<div class="titleArea">
				<h3><img src="<%=cp%>/community/image/h3_photo_gallery.gif" alt="공지사항" /><span class="visualImg"><img src="<%=cp%>/community/image/img_visual.gif"  alt="비주얼이미지" /></span></h3>
			</div>

			<div class="tab_travelguide01">
				<ul><li class="space">&nbsp;</li>
					<li class="first"><a href="<%=cp%>/community/gallary.action">유럽</a></li><li>┃</li>
					<li><a href="<%=cp%>/community/gallery2.action" class="on">아시아</a></li><li>┃</li>
					<li><a href="<%=cp%>/community/gallery3.action">아메리카</a></li><li>┃</li>
					<li><a href="<%=cp%>/community/gallery4.action">오세아니아</a></li><li>┃</li>
					<li><a href="<%=cp%>/community/gallery5.action">아프리카</a></li>
				</ul>
			</div>
            <br/><br/>
            <table width="600" border="0" cellspacing="1" cellpadding="3" bgColor="#FFFFFF" align="center">
				 <tr> 
				  <c:forEach var="dto" items="${lists}">   
				  <td>
				  <table width="160" height="140" style="BORDER-BOTTOM: #BDBDBD 1px solid; BORDER-LEFT: #BDBDBD 1px solid; BORDER-TOP: #BDBDBD 1px solid; BORDER-RIGHT: #BDBDBD 1px solid; PADDING-TOP: 5px; padding-right: 5px; padding-left: 5px; padding-bottom: 5px;">
				  <% i=i+1; %>
				   <tr bgcolor="#FFFFFF" align="center">
				    <td align="center">
				    <%-- <a href="${dto.urlFile }"> --%><img src="${imagePath}${dto.saveFileName}" width="150" height="110" alt=""></a></td>
				   
				   </tr>
				   <tr bgcolor="#FFFFFF" align="center">
				    <td align="center">
				    <b>${dto.subject }</b></td>
				    <c:if test="${userId == 'admin'}">
				    <td align="right">
				    <a href="<%=cp %>/community/delete2.action?fileNum=${dto.num}&pageNum=${pageNum}">삭제</a></td> 
				    </c:if>
				    </tr>
				   
				  </table>
				  </td>
				  <% 
				   if(i%3 == 0){
				   out.print("</tr>");
				   out.print("<tr>");
				   }
				  %>
				  
				  </c:forEach>
				 </tr>
 
 			</table> 

			<!-- 내용 // -->
 			<br/>
			<!-- Paging -->
			<div class="pageNotice">
				<p class="page"><b>${pageNum}</b> 페이지 / 총 <b>${totalPage}</b> 페이지</p>
                <div class="paging">
                     <p>
				<c:if test="${totalDataCount != 0}">
					${pageIndexList}
				</c:if>
				<c:if test="${totalDataCount == 0}">
					등록된 게시물이 없습니다.
				</c:if>
			</p>
            </div>
            <c:if test="${userId == 'admin'}">
            	<div class="btnAreaR"><a href="javascript:location.href='<%=cp%>/community/save.action?pageNum=${pageNum }';"><img src="<%=cp%>/info/image/regist.gif"  alt="등록하기" /></a>
            </div>      
			</c:if>
			<!-- Paging //-->
			<div class="searchBox">
				<form name="searchForm" method="post" action="">
				<select class="type_select2" id="SearchType" name="searchKey">
					<option value="subject">나라</option>
				</select>
				<input type="text" class="type_text2" id="SearchValue" name="searchValue"/>
				<a href="#"><img src="<%=cp%>/info/image/search.gif" alt="검색" onclick="searchData();" /></a>
				</form>
			</div>
		</div>
	</div>
</div>
</body>

</html>